import {Routes} from '@angular/router';
import {NotFoundComponent} from './shared/components/not-found';
import {ChangeTitle} from './shared/services/change-title.service';

export const appRoutes: Routes = [
  {
    path: '',
    canActivateChild: [ChangeTitle],
    children: [
      {path: '', pathMatch: 'full', redirectTo: '/home'},
      {
        path: 'user', data: {title: '用户中心'},
        loadChildren: './user/user.module#UserModule'
      },
      {
        path: 'home', data: {title: '首页'},
        loadChildren: './home/home.module#HomeModule'
      },
      {path: '**', data: {title: '404'}, component: NotFoundComponent},
    ]
  },
];
